# coding: utf-8
module PostsHelper

	def thumbPic(pic)
		return nil if pic == nil
		pic.dup.gsub('original', 'thumb')
	end

	def mediumPic(pic)
		return nil if pic == nil
		pic.dup.gsub('original', 'medium').gsub('thumb', 'medium')
	end

	# 上下篇
	def prenext(post)
		if(post != nil and post.length == 1)
			return "<a href=\"/detail/#{post.first.id}.html\">#{post.first.title}</a>"
		end
		return '无'
	end

end
